//
//  ZZBeautyBigFansSelectedView.m
//  新项目
//
//  Created by liGordon on 17/3/17.
//  Copyright © 2017年 刘耀宗. All rights reserved.
//

#import "ZZBeautyBigFansSelectedView.h"

@implementation ZZBeautyBigFansSelectedView

+(instancetype)ViewWithXib
{
    ZZBeautyBigFansSelectedView *view=[[[NSBundle mainBundle] loadNibNamed:@"ZZBeautyBigFansSelectedView" owner:nil options:nil]lastObject];
    return view;
    
}
-(void)awakeFromNib
{
    [super awakeFromNib];
    
    
}

- (IBAction)clickForSeletecd:(id)sender {
    if ([self.delegate respondsToSelector:@selector(clickForSeletectedDataWithSTwice:andETwice:andName:)]) {
        if (self.customNameField.text.length==0||self.customNameField.text==nil||[[self.customNameField.text class] isSubclassOfClass:[NSNull class]]) {
            self.customNameField.text=@"";
        }
     
        if (self.startField.text.length==0||self.startField.text==nil||[[self.startField.text class] isSubclassOfClass:[NSNull class]]) {
            self.startField.text=@"";
        }
        if (self.endField.text.length==0||self.endField.text==nil||[[self.endField.text class] isSubclassOfClass:[NSNull class]]) {
            self.endField.text=@"";
        }
  
        // 判断有值
        if(self.endField.text.length > 0 && self.startField.text.length >0){
            
            if ([self.endField.text integerValue]<[self.startField.text integerValue]) {
                [MBProgressHUD showError:@"开始次数应小于结束次数"];
                return;
            }else{
                [self.delegate clickForSeletectedDataWithSTwice:self.startField.text andETwice:self.endField.text andName:self.customNameField.text];
            }
        }else if(self.endField.text.length > 0 || self.startField.text.length >0){
            [MBProgressHUD showError:@"请输入开始次数和结束次数查询"];
            return;
        }else{
            [self.delegate clickForSeletectedDataWithSTwice:self.startField.text andETwice:self.endField.text andName:self.customNameField.text];
        }
        
        
        

      
    }
}
- (IBAction)clickForHiden:(id)sender {
    if ([self.delegate respondsToSelector:@selector(hiddenTheView)]) {
        [self.delegate hiddenTheView];
    }
}

@end
